//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package objects;

import common.GlobalID;

import java.util.Collection;
import java.util.LinkedHashMap;

public class ProcessingBuildings {
    private static LinkedHashMap<Integer, FactoryEntry> factoryById = new LinkedHashMap();
    private static LinkedHashMap<String, FactoryEntry> factoryByName = new LinkedHashMap();

    public ProcessingBuildings() {
    }

    public static void addFactory(String name, int slots, int unlockLevel, int timeMin, int timeSec, int ExpToBuild) {
        int id = GlobalID.create(6, factoryById.size());
        FactoryEntry fe = new FactoryEntry(name, slots, unlockLevel, id, timeMin, timeSec, ExpToBuild);
        factoryById.put(Integer.valueOf(fe.getId()), fe);
        factoryByName.put(fe.getName(), fe);
    }

    public static FactoryEntry getById(int id) {
        return (FactoryEntry)factoryById.get(Integer.valueOf(id));
    }

    public static FactoryEntry getByName(String name) {
        return (FactoryEntry)factoryByName.get(name);
    }

    public static void clear() {
        factoryById.clear();
        factoryByName.clear();
    }

    public static Collection<FactoryEntry> getFactories() {
        return factoryById.values();
    }
}
